- Numpy provides the functionality for storing and reading numpy array from file, helpful for storing and loading the procesed data.
- Adds
.npyextension to the filename, stores in non-ascii format.
>>> a = np.array([[np.random.randint(-5,5) for i in range (5)] for j in range(5)])
>>> np.save('./test', a)
>>> b = np.load('./test.npy')
>>> b
array([[-2, 3, -3, -1, 1],
[-4, 0, 2, 0, -2],
[-3, -1, -2, -5, 2],
[ 4, 4, -1, -4, 3],
[-3, 3, 3, 4, 4]])
>>> a == b
array([[ True, True, True, True, True],
[ True, True, True, True, True],
[ True, True, True, True, True],
[ True, True, True, True, True],
[ True, True, True, True, True]])
>>> a is b
False